/**
 * Copyright &copy; 2012-2016 <a href="https://www.kaaction.com">KAA</a> All rights reserved All rights reserved.
 */
package com.kaaction.modules.eb.entity;

import org.hibernate.validator.constraints.Length;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.kaaction.common.persistence.DataEntity;

/**
 * 优惠券明细Entity
 * @author zengbiao
 * @version 2017-05-02
 */
public class CouponDetail extends DataEntity<CouponDetail> {
	
	private static final long serialVersionUID = 1L;
	private Coupon coupon;		// coupon_id
	private String customerId;		// customer_id
	private String code;		// 验证码
	private String status;		// 0=未领取，1=已抽中，2=已领取，3=已使用,90=已过期，99=已废弃
	private Date pickDate;		// 领取日期
	private Date useDate;		// 使用日期
	
	public CouponDetail() {
		super();
	}

	public CouponDetail(String id){
		super(id);
	}

	@Length(min=1, max=64, message="coupon_id长度必须介于 1 和 64 之间")
	public Coupon getCoupon() {
		return coupon;
	}

	public void setCoupon(Coupon coupon) {
		this.coupon = coupon;
	}
	
	@Length(min=0, max=64, message="customer_id长度必须介于 0 和 64 之间")
	public String getCustomerId() {
		return customerId;
	}

	public void setCustomerId(String customerId) {
		this.customerId = customerId;
	}
	
	@Length(min=1, max=8, message="验证码长度必须介于 1 和 8 之间")
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
	
	@Length(min=1, max=3, message="0=未领取，1=已抽中，2=已领取，3=已使用,90=已过期，99=已废弃长度必须介于 1 和 3 之间")
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getPickDate() {
		return pickDate;
	}

	public void setPickDate(Date pickDate) {
		this.pickDate = pickDate;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getUseDate() {
		return useDate;
	}

	public void setUseDate(Date useDate) {
		this.useDate = useDate;
	}
	
}